package com.two.service.permission.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.two.common.entity.Role;
import com.two.common.util.CommonResult;
import com.two.service.permission.mapper.RoleMapper;
import com.two.service.permission.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 汪瑞明
 * @since 2022-09-01
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public CommonResult selectAll() {
        List<Role> roles = roleMapper.selectList(null);
        if (roles!=null){
            return new CommonResult(2000,"查询成功",roles);
        }
        return new CommonResult(5000,"查询失败",null);
    }
}

